<template>
  <el-dialog
    title="cron表达式生成器"
    top="2vh"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    :show-close="false"
    :visible.sync="showCron"
  >
    <Crontab
      :expression="expression"
      @hide="showCron=false"
      @fill="crontabFill"
    />
  </el-dialog>
</template>

<script>
import Crontab from '@/components/Crontab/index.vue'
export default {
  components: {
    Crontab
  },
  props: {
    expression: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      showCron: false
    }
  },
  methods: {
    crontabFill(value) {
      this.input = value
      this.$emit('generateCron', value)
    }
  }
}
</script>

